package com.ambimmort.shj.action.traffic.flow.group;

import com.ambimmort.shj.service.traffic.flow.group.TrafficFlowGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Josh on 2015/7/31.
 */
@Controller("/action/traffic_flow/edit_areas.do")
public class Edit_Traffic {
    @Autowired
    private TrafficFlowGroupService trafficFlowGroupService;

    /**
     *
     * @param request
     * @param response
     * @param json
     * @return
     */
    @RequestMapping("/action/traffic_flow/edit_areas.do")
    @ResponseBody
    public String edit_areas_traffic_flow(HttpServletRequest request, HttpServletResponse response, @RequestParam("json") String json) {

            int row = trafficFlowGroupService.edit_Traffic(json);
            if (row != 0) {
                return "{\"result\":\"true\"}";
            } else {
                return "{\"result\":\"false\"}";
            }
    }
}
